/*
 * @LastEditTime : 2022-11-03 16:14:26
 * @FilePath     : /pyy/src/http/modules/equipment.js
 * @Description  : api > 设备计量
 */
import axios from "@/utils/axios";

/**
 * 人员唯一标识
 */
const OPEN_ID = localStorage.userId; //上线用
// const OPEN_ID = '221122';

export default {
  /**
   * 获取 列表数据
   * @param {object} params: 请求参数
   * @param {number} params.page: 分页页码
   * @param {number} params.size: 分页条数
   * @param {string} params.query: 模糊查询数据
   */
  getList(params) {
    return axios({
      url: "webjars/metering/getMeteringList/" + OPEN_ID,
      method: "POST",
      data: params,
    });
  },

  /**
   * 获取 设备计量 详情
   * @param {string} id: 设备计量数据id
   */
  getDetail(id) {
    return axios({
      url: "webjars/myzfile/getMeteringDetails/" + id,
      // url: "/metering/getMeteringDetails/" + id,
      method: "GET",
    });
  },

  /**
   * 获取 设备附件列表
   * @param {string} id: 设备计量详情数据中的设备id
   */
  getEnclosure(zslb,ywdh,wtdh) {
    return axios({
      url: "webjars/metering/findAttachment/" + zslb+"/" + ywdh+"/" + wtdh,
      method: "GET",
    });
  },
    /**
   * 获取 枚举
   * 
   */
     getEnumeratedValues() {
      return axios({
        url: "webjars/metering/getMeteringEnum/" ,
        method: "GET",
      });
    },
        /**
   * 提交委托单
   * 
   */
         submitOrders(params) {
          return axios({
            url: "webjars/metering/sendMeteringProcess/"+ OPEN_ID ,
            method: "POST",
            data: params,
          });
        },
      /**
       * 查看证书详情
       * 
       */
      checkTheCertificateDetails(id) {
        return axios({
          url: "webjars/file/downloadService/"+ id ,
          method: "GET",

        });
  },
       /**
       * 下载模板
       * 
       */
        downloadTheTemplate() {
          return axios({
            url: "webjars/file/downloadSlsxTemplate",
            method: "GET",

          });
      },
      /**
       * 上传文件 返回数据
       * 
       */
       uploadAFile(params) {
        return axios({
          url: "webjars/metering/saveXlsx",
          method: "POST",
          data: params,

        });
    },
};
